define(function(require, exports, module){
    window.still = window.still || {};
    still.Util = {
        //获得地址栏传参的方法
        getRequest : function(l) {
          var location = l || window.location;
          var url = location.search, //获取url中"?"符后的字串
          hash = location.hash;
          var theRequest = new Object();
          if (url.indexOf("?") != -1) {
            var str = url.substr(1),
            strs = str.split("&");
            for(var i = 0; i < strs.length; i ++) {
              theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
            }
          }else if( location.href.indexOf("#") != -1){
            str2 = hash.substr(1);
            strs2 = str2.split("#");
            for(var i = 0; i < strs2.length; i ++) {
              theRequest[strs2[i].split("=")[0]]=(strs2[i].split("=")[1]);
            }
          }
          return theRequest;
        },
        /*在一段时间内监控某dom是否加载完成 
        *domId, 需要监控的节点的id
        *func, dom加载完成后的回调函数
        *timesetp, 循环间隔, 默认为50毫秒
        *timewait, 最长等待时间, 默认为3000毫秒
        */
        domReady : function (domId,func,timesetp,timewait){
            var t = typeof timesetp == 'number' ? timesetp : 50;
            var wait = typeof timewait == 'number' ? timewait : 3000;
            var callback = typeof func == 'function' ? func : function(){};
            var si = setInterval(function(){
                if($('#'+domId)[0]){
                    clearInterval(si);
                    return callback();
                }
            },t);
            setTimeout(function(){
                clearInterval(si);
            },wait);
        },
        //字符串转js对象
        strToObj : function(str){
            if(typeof str =='string'){
                if(str.charAt(0)!='{'){
                    str = eval('"{"+str+"}"');
                }
                return eval("("+str+")");
            }else{
                return str;
            }
        },
        //复制对象
        clone : function(obj){
            var cloneObj = obj ? {} : obj;
            for(var key in obj){
                cloneObj[key] = obj[key];
            }
            return cloneObj;
        }
    }        
});